cmake_minimum_required(VERSION 3.20)
#cmake_policy(SET CMP0144 OLD)
project(laser_odometry)
include_directories(
  include
  ${Boost_INCLUDE_DIRS}
  ${PCL_LIBRARY_DIRS}
  ${EIGEN3_INCLUDE_DIR}
)
# 查找依赖
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(PCL REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)

# 添加可执行文件
add_executable(laser_to_tf src/laser_tf.cpp src/fuction_temp.cpp)

# 链接库
ament_target_dependencies(laser_to_tf
  rclcpp
  sensor_msgs
  pcl_conversions
  tf2
  tf2_ros
)

target_link_libraries(laser_to_tf ${PCL_LIBRARIES})

# 安装规则
install(TARGETS
  laser_to_tf
  DESTINATION lib/${PROJECT_NAME}
)
install(DIRECTORY launch config
  DESTINATION share/${PROJECT_NAME}
)
# 导出包
ament_package()